import axiosInstance, { ResDataType } from "./ajax"

// 获取问卷的统计列表
export async function getQuestionStatListService(questionId: string, opt: { page: number; pageSize: number }): Promise<ResDataType> {
    const url = `/api/stat/${questionId}`
    const data = (await axiosInstance.get(url, { params: opt })) as ResDataType
    return data
}

// 获取组件统计数据
export async function getComponentStatService(questionId: string, componentId: string) {
    const url = `/api/stat/${questionId}/${componentId}`
    const data = (await axiosInstance.get(url)) as ResDataType
    return data
}
